import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'app',
    component: () => import('@/views/layout/index'),
    redirect: '/home',
    children: [{
      path: 'home',
      component: () => import('@/views/home/home')
    },
    {
      path: 'userM',
      name: 'userManage',
      component: () => import('@/views/adminManage/userM')
    },
    {
      path: 'adminM',
      name: 'adminManage',
      component: () => import('@/views/adminManage/adminM')
    },
    {
      path: 'book',
      name: 'Book',
      component: () => import('@/views/book/index')
    },
    {
      path: 'book',
      name: 'Book',
      component: () => import('@/views/book/index')
    }
    ]

  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index')
  }
]

const router = new VueRouter({
  routes
})

export default router
